import { Fragment, defineComponent, reactive } from 'vue';
import { viewContainer, twoD } from './View.module.scss';
import { map } from '@/store';
// import twoD from '@/assets/img/2d.png';
import threeD from '@/assets/img/3d.png';
/*
---文件
*/
export const viewObj = reactive({
    isShow: true,
})

export default defineComponent({
    name: 'View',
    data() {
        return {
        };
    },
    methods: {
        setViewMode() {
            if (!map.isView3d) {
                // @ts-ignore
                map.fmap.setViewMode({ mode: fengmap.FMViewMode.MODE_3D })
            } else {
                // @ts-ignore
                map.fmap.setViewMode({ mode: fengmap.FMViewMode.MODE_2D })
            }
            map.isView3d = !map.isView3d
        }
    },
    render() {
        return <Fragment>
            <div class={viewContainer} v-if={viewObj.isShow} onClick={this.setViewMode}>
                {map.isView3d ? <img src={threeD} /> : <div class={twoD}>2D</div>}
            </div>
        </Fragment>;
    },
});